package com.fingard.dsp.bank.reqrespobj.contract;

import com.fingard.dsp.bank.reqrespobj.ReqRespHeader;
import com.fingard.dsp.bank.reqrespobj.RequestBase;
import com.fingard.dsp.bank.reqrespobj.contract.detail.ReqContractDetail;
import com.fingard.xml.XmlTextReader;

public class ReqQryBatContract extends RequestBase {
    public String ownAct = "";

    private XmlTextReader xmlReader;
    public ReqContractDetail contractDetail = null;

    public ReqQryBatContract() {
    }

    public ReqQryBatContract(XmlTextReader p_xmlReader, ReqRespHeader p_header) throws Exception {
        reqHeader = p_header;
        xmlReader = p_xmlReader;
        ownAct = xmlReader.getSimpleText("RecAct");
    }

    public boolean readRecord() throws Exception {
        contractDetail = null;
        if (xmlReader.read(PATH_Detail)) {
            contractDetail = new ReqContractDetail(xmlReader.readedXElement, reqHeader.transType, reqHeader.bankCode);
            return true;
        } else {
            return false;
        }
    }
}